Skip to content

20260616-aes-fixes#10709

Merged
JacobBarthelmeh merged 4 commits into
wolfSSL:masterfrom
douzzer:20260616-aes-fixes
Jun 17, 2026
Merged

20260616-aes-fixes#10709
JacobBarthelmeh merged 4 commits into
wolfSSL:masterfrom
douzzer:20260616-aes-fixes

Conversation

@douzzer

@douzzer douzzer commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

wolfcrypt/src/aes.c: catch and error on total length overflow in wc_AesGcmEncryptUpdate(), wc_AesGcmDecryptUpdate(), wc_AesCcmEncrypt(), and wc_AesCcmEncrypt().

tested with

wolfssl-multi-test.sh ...
super-quick-check

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #10709

Scan targets checked: wolfcrypt-bugs, wolfcrypt-src

Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Findings are non-blocking.

Comment thread wolfcrypt/src/aes.c Outdated
@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown

MemBrowse Memory Report

gcc-arm-cortex-m4

  • FLASH: .rodata.str1.1 -4 B (-0.0%, 199,052 B / 262,144 B, total: 76% used)

gcc-arm-cortex-m4-crypto-only

  • FLASH: .rodata.str1.1 -4 B (-0.0%, 173,674 B / 262,144 B, total: 66% used)

gcc-arm-cortex-m4-openssl-compat

  • FLASH: .text +64 B (+0.0%, 767,796 B / 1,048,576 B, total: 73% used)

gcc-arm-cortex-m4-pkcs7

  • FLASH: .rodata.str1.1 -4 B, .text +64 B (+0.0%, 211,373 B / 262,144 B, total: 81% used)

gcc-arm-cortex-m4-pq

  • FLASH: .rodata -8 B (-0.0%, 277,936 B / 1,048,576 B, total: 27% used)

gcc-arm-cortex-m4-rsa-only

  • FLASH: .rodata -8 B (-0.0%, 323,472 B / 1,048,576 B, total: 31% used)

gcc-arm-cortex-m4-tls13

  • FLASH: .rodata.str1.1 -4 B (-0.0%, 234,686 B / 262,144 B, total: 90% used)

gcc-arm-cortex-m7

  • FLASH: .rodata.str1.1 -4 B (-0.0%, 199,052 B / 262,144 B, total: 76% used)

gcc-arm-cortex-m7-pq

  • FLASH: .rodata -8 B (-0.0%, 278,512 B / 1,048,576 B, total: 27% used)

gcc-arm-cortex-m7-tls13

@douzzer douzzer force-pushed the 20260616-aes-fixes branch 2 times, most recently from a9fefc4 to f1b8d03 Compare June 17, 2026 03:11
Comment thread wolfcrypt/src/aes.c Outdated
@douzzer douzzer requested a review from Frauschi June 17, 2026 14:29

@Frauschi Frauschi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add test coverage for the OVERFLOW_E cases?

Comment thread wolfcrypt/src/aes.c Outdated
Comment thread wolfcrypt/src/aes.c Outdated

@dgarske dgarske left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skoll Code Review

Scan type: reviewOverall recommendation: COMMENT
Findings: 5 total — 4 posted, 1 skipped
4 finding(s) posted as inline comments (see file-level comments below)

Posted findings

  • [Low] Comment typo: 'cunulative' should be 'cumulative'wolfcrypt/src/aes.c:12813,12967
  • [Low] Brace-on-own-line and redundant double parentheses deviate from file stylewolfcrypt/src/aes.c:12816-12821,12970-12975
  • [Low] Bare 0xffffffff literal; prefer suffixed/named constantwolfcrypt/src/aes.c:12817-12818,12971-12972
  • [Low] Reused AES_CCM_OVERFLOW_E error string is about 'invocation counter', not input lengthwolfcrypt/src/aes.c:13621,13785

Skipped findings

  • [Medium] No tests added for new AES-GCM/CCM overflow error paths

Review generated by Skoll

Comment thread wolfcrypt/src/aes.c
Comment thread wolfcrypt/src/aes.c
Comment thread wolfcrypt/src/aes.c Outdated
Comment thread wolfcrypt/src/aes.c
douzzer added 2 commits June 17, 2026 12:01
…esGcmEncryptUpdate(), wc_AesGcmDecryptUpdate(), wc_AesCcmEncrypt(), and wc_AesCcmEncrypt().
@douzzer douzzer force-pushed the 20260616-aes-fixes branch from f1b8d03 to 1070384 Compare June 17, 2026 17:01
@douzzer douzzer requested review from Frauschi and dgarske June 17, 2026 17:02

@dgarske dgarske left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skoll Multi-Scan Review

Modes: reviewOverall recommendation: COMMENT
Findings: 3 total — 3 posted, 0 skipped
3 finding(s) posted as inline comments (see file-level comments below)

One or more scans did not complete — the results below are partial.

Posted findings

  • [Low] [review] GCM aSz (AAD) overflow branch is not exercised by testswolfcrypt/test/test.c:19152-19161,19179-19188
  • [Low] [review] Raw sizeof in mixed-signedness comparison deviates from function's wordSz conventionwolfcrypt/src/aes.c:13618,13782
  • [Info] [review] Test code pointer style and line length deviate from wolfSSL conventionswolfcrypt/test/test.c:21128-21130

Review generated by Skoll

Comment thread wolfcrypt/test/test.c Outdated
Comment thread wolfcrypt/src/aes.c
Comment thread wolfcrypt/test/test.c Outdated

@dgarske dgarske left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread wolfcrypt/src/aes.c Outdated
douzzer added 2 commits June 17, 2026 13:18
…c/port/riscv/riscv-64-aes.c, wolfcrypt/src/port/silabs/silabs_aes.c, wolfcrypt/src/port/ti/ti-aes.c: implement AES-CCM counter overflow checks for ports;

wolfcrypt/test/test.c: add missing !HAVE_SELFTEST gate around AES-CCM counter overflow test in aesccm_128_badarg_test();

wolfcrypt/src/error.c and wolfssl/wolfcrypt/error-crypt.h: update messages for AES_{GCM,CCM}_OVERFLOW_E.
…her than magic 0xffffffff;

wolfcrypt/test/test.c: in aesgcm_stream_test(), implement tests for sSz overflow, and in aesccm_128_badarg_test(), fix line length.
@douzzer

douzzer commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

Note latest push passed super-quick-check here.

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #10709

Scan targets checked: wolfcrypt-bugs, wolfcrypt-port-bugs, wolfcrypt-rs-bugs, wolfcrypt-src, wolfssl-bugs, wolfssl-src

No new issues found in the changed files. ✅

@JacobBarthelmeh

Copy link
Copy Markdown
Contributor

Retest this please Jenkins. Generic config failed. --enable-linuxkm-defaults --enable-all --enable-crypttests --enable-examples --disable-asm --enable-stacksize=verbose CFLAGS="-DWOLFSSL_TEST_MAX_RELATIVE_STACK_BYTES=8192" failed ocsp-stappling during make check

@douzzer

douzzer commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

retest this please
FAIL: scripts/ocsp-stapling2.test

@JacobBarthelmeh JacobBarthelmeh dismissed Frauschi’s stale review June 17, 2026 21:54

Test case was added and feedback was addressed.

@JacobBarthelmeh JacobBarthelmeh merged commit 3f9ae22 into wolfSSL:master Jun 17, 2026
304 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For This Release Release version 5.9.2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants